<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="demo">
        <input type="text" name="" id="" @keyup.enter="search">
        <ul>
            <li v-for="star in newStars">{{star}}</li>
        </ul>
    </div>
    <script>
        new Vue({
            el: '#demo',
            data: {
                stars: [
                    '周杰伦',
                    '周冬雨',
                    '马冬梅',
                    '邓伦'
                ],
                newStars: [
                    '周杰伦',
                    '周冬雨',
                    '马冬梅',
                    '邓伦']
            },
            methods: {
                search(e) {
                    this.newStars = this.stars.filter(star => star.includes(e.target.value))
                }
            }
        })
    </script>
</body>

</html>